<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>传图识字</title>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>

    <script type="text/javascript">
        $(window).ready(function () {
            $("#upload").click(function () {
                var file = new FormData($("#form")[0]);//获取表单中的文件
                $.ajax({
                    url:"/ocr/highPrecisionImageRecognition",//后台的接口地址
                    type:"post",//post请求方式
                    data:file,//参数
                    cache: false,
                    processData: false,
                    contentType: false,
                    success:function (data) {
                        console.log(data.data)
                        $('#result').text(data.data.words_result)
                    },error:function () {
                        $('#result').text("解析错误")
                    }

                })
            });
        });


    </script>
</head>
<body>

<form id="form" action="" method="post" enctype="multipart/form-data">
    <p>请选择图片:</p>
    <input id="file" name="file" type="file" multiple="multiple"/>
    <br>
    <input id="upload" name="upload" type="button" value="上传">
    <br>

    <span>解析结果:</span>
    <br>
    <span id="result"></span>
    <br>

</form>

</body>
</html>